package com.cuc.platform.core.dao.baseInfo.jdbctemplate;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.cuc.platform.core.dao.baseInfo.AttrTypeDao;
import com.cuc.platform.core.domain.baseInfo.AttrType;

@Repository("attrTypeDao") 
public class AttrTypeDaoImpl implements AttrTypeDao{

	@Override
	public List<AttrType> getAllAttrTypes() {
		String sql = "select * from sa_attr_type";
		List<AttrType>  list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<AttrType>(AttrType.class));
		return list;
	}

	@Override
	public AttrType getAttrType(Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void insertAttrType(AttrType attrType) throws DataAccessException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void updateAttrType(AttrType attrType) throws DataAccessException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int delAttrType(Long id) throws DataAccessException {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<AttrType> queryAttrTypes(AttrType attrType)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}
	

	/**
	 * Ioc
	 */
	@Resource
	private JdbcTemplate jdbcTemplate;
}
